﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace anowak.BDD.Compiler
{
    class Program
    {
        static void Main(string[] args)
        {
            //process input parameters

            //read file  => 
            //scan file (mark tokens)
            //tokenize (read tokens and their context)
            //prepare output structure
            //prepare output string
            //write to new file

            FileReader reader = new FileReader("Resources/gherkinExample2.gherkin");
            try
            {
                reader.read();
                reader.removeNonLetterOrDigit();
            }
            catch (Exception ex) { }
            GherkinTokenFinder finder = new GherkinTokenFinder();
            finder.find(reader.Content);
            //foreach (tokenlocation tl in finder.tokenslist)
            //    system.console.writeline(
            //        tl.tokentype.tostring() + "\n"
            //        + "numer linii\t" + tl.tokenlinenumber + "\n" +
            //        "char start\t" + tl.tokenstartcharnumber + "\n" +
            //        "char stop\t" + tl.tokenstartcharnumber + "\n" +
            //        "token length\t" + tl.tokenlength + "\n");
            GherkinTokenContentExtractor extractor = new GherkinTokenContentExtractor(reader.Content, finder.TokensList);
            extractor.processContent();
            //foreach (TokenContent tc in extractor.ContentList)
            //    System.Console.WriteLine(
            //        tc.TokenType + "\n"
            //        + "String\t" + tc.Content + "\n" );
            System.Console.Write(reader.ContentString());
            System.Console.ReadKey();
        }
    }
}
